package com.jxtc.enterprise.common.constants;

public enum OrderPaymentStatus {
    WAIT("待支付", 1),
    // 代发货状态已弃用，支付完成后订单状态直接修改为待收货
    TO_SEND("待发货", 2),
    TO_RECEIVE("待收货", 3),
    TO_REVIEW("待评价", 4),
    CANCELED("已取消", 5),
    AFTER_SALE("售后已处理", 6),
    REFUNDED("已退款", 7),
    COMPLETED("已完成", 8);

    private final String name;
    private final int value;

    OrderPaymentStatus(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public int getValue() {
        return value;
    }

    public static String getNameByValue(int value) {
        for (OrderPaymentStatus status : OrderPaymentStatus.values()) {
            if (status.getValue() == value) {
                return status.getName();
            }
        }
        return null;
    }
}
